<% 
	var list_li = '';
	var wip_enabled = false;
	if (!_.isUndefined(APPS) && APPS !== null && !_.isUndefined(APPS.enabled_apps) && APPS.enabled_apps !== null && $.inArray('r_agile_wip',APPS.enabled_apps) !== -1) {
		wip_enabled = true;
	}
	_.each(filtered_lists, function(filtered_list) {
		 if (filtered_list.id == list.attributes.id) {
			 list_li += '<li class="disabled navbar-btn"><a href="#" class="js-no-action text-muted">' + _.escape(filtered_list.attributes.name) + ' '+i18next.t('(current)')+'</a></li>';
		 } else {
			if (wip_enabled &&  !_.isUndefined(filtered_list.attributes.custom_fields) && !_.isEmpty(filtered_list.attributes.custom_fields)) {
				var list_custom_fields = JSON.parse(filtered_list.attributes.custom_fields);
				var list_card_count = isNaN(filtered_list.attributes.card_count) ? 0 : filtered_list.attributes.card_count;
				if (!_.isUndefined(list_custom_fields.wip_limit) && !_.isEmpty(list_custom_fields.wip_limit)) {
					if (parseInt(list_card_count) === parseInt(list_custom_fields.wip_limit) && !_.isUndefined(list_custom_fields.hard_wip_limit) && !_.isEmpty(list_custom_fields.hard_wip_limit)) {
						list_li += '<li class="disabled navbar-btn"><a href="#" class="js-no-action text-muted">' + _.escape(filtered_list.attributes.name) + ' ('+ i18next.t('Agile WIP exceeded')+')</a></li>';
					} else if(parseInt(list_card_count) > parseInt(list_custom_fields.wip_limit)) {
						list_li += '<li class="navbar-btn"><a href="#" class="js-move-cards js-close-popup" data-move-list-id="' + filtered_list.id + '">' + _.escape(filtered_list.attributes.name) + ' ( > '+ i18next.t('WIP limit')+')</a></li>';	
					} else {
						list_li += '<li class="navbar-btn"><a href="#" class="js-move-cards js-close-popup" data-move-list-id="' + filtered_list.id + '">' + _.escape(filtered_list.attributes.name) + '</a></li>';	
					}
				} else {
					list_li += '<li class="navbar-btn"><a href="#" class="js-move-cards js-close-popup" data-move-list-id="' + filtered_list.id + '">' + _.escape(filtered_list.attributes.name) + '</a></li>';
				}
			} else {
				list_li += '<li class="navbar-btn"><a href="#" class="js-move-cards js-close-popup" data-move-list-id="' + filtered_list.id + '">' + _.escape(filtered_list.attributes.name) + '</a></li>';
			}
		 }
	 });
%>
<li class="clearfix text-center col-xs-12">
	<div class="clearfix">
	<a href="#" class="js-back-to-list-actions pull-left" data-list-id="<%- list.id%>"><i class="icon-caret-left"></i></a><span class="col-xs-10"><strong><%- i18next.t('Move All Cards in This List') %></strong></span><a class="js-close-popup pull-right" href="#"><i class="icon-remove"></i></a>
	</div>
</li>
<li class="col-xs-12 divider"></li>
<%= list_li%>